<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>注册 - 用户中心</title>
		<%@ include file="/common/include/title.jsp"%>

	</head>
<body>
	<!-- 网页头部开始 -->
	<%@ include file="/common/include/header.jsp"%>
	
	<div class="container">
		<div class="col-sm-8 col-sm-offset-1">
			<form id="form" class="form-horizontal" method="post" action="${rootpath }/regsiterSubmit.htm">
				<h2 class="col-sm-offset-1 form-signin-heading">快速注册</h2>
				<div class="form-group">
	                <label for="year" class="col-sm-2 control-label">入学年份</label>
	                <div class="col-sm-8">
	                	<input type="number" class="form-control" id="year" value="${year }" name="year" required="required"
	                	placeholder="请输入入学年份">
            		</div>
            	</div>
            	<div class="form-group">
	                <label for="clazz" class="col-sm-2 control-label">班级:</label>
	                <div class="col-sm-8">
		                <select name="cid" class="form-control" >
		                    <c:forEach items="${clazz}" var="clazz">
		                        <option value="${clazz.id}">${clazz.name}</option>
		                    </c:forEach>
		                </select>
	                </div>
            	</div>
            	<div class="form-group">
	                <label for="loginName" class="col-sm-2 control-label">用户名/学号</label>
	                <div class="col-sm-8">
		                <input type="text" class="form-control" required="required" id="loginName" 
		                value="${loginName}" name="loginName" placeholder="用户名/学号">
            		</div>
            	</div>
            	<div class="form-group">
	                <label class="col-sm-2 control-label">我是：</label>
	                <div class="col-sm-8">
		                <select name="type" class="form-control" >
		                    <option value="1">学生</option>
		                    <option value="2">老师</option>
		                </select>
		           	</div>
            	</div>
				<div class="form-group">
					<label for="password" class="col-sm-2 control-label">密码</label>
					<div class="col-sm-8">
						<input type="password" name="password" id="password" class="form-control" required="required"
						placeholder="请输入密码" />
					</div>
				</div>
				<div class="form-group">
					<label for="confirmPassword" class="col-sm-2 control-label">确认密码</label>
					<div class="col-sm-8">
						<input type="password" class="form-control" data-match="#password" data-match-error="两次密码不一致" 
						required="required" id="repassword" value="${repassword}" name="repassword" placeholder="请确认密码">
					</div>
				</div>
				<div class="form-group">
	                <label for="name" class="col-sm-2 control-label">姓名</label>
	                <div class="col-sm-8">
		                <input type="text" class="form-control"
		                       required="required" id="name" value="${name}" name="name" placeholder="姓名">
            		</div>
            	</div>
            	<div class="form-group">
	                <label for="name" class="col-sm-2 control-label">手机号</label>
	                <div class="col-sm-8">
		                <input type="text" pattern="^(1)([0-9]){10}$" class="form-control" required="required" 
		                id="mobile" value="${mobile}" name="mobile" placeholder="请输入手机号码">
            		</div>
            	</div>
				<div class="form-group">
					<div class="col-sm-8 col-sm-offset-2">
						<button class="btn btn-lg btn-primary" type="submit">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>

	<!-- 提示信息 -->
	<c:if test="${info != null && info != '' }">
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				<div class="alert alert-warning alert-dismissible fade in" role="alert">
					<button type="button" class="close" data-dismiss="alert" aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					${info }
				</div>
			</div>
		</div>
	</c:if>

	<script>
	    $(document).ready(function () {
	         var repassword=$("#repassword").blur(function () {
	            var password=$("#password").val();
	            if(password!=$(this).val()){
	                $(this).next().css('color','red').html("两次输入的密码不一致！");
	                return ;
	            }else{
	                $(this).next().html("");
	            }
	         })
	    });
	</script>
	
	<%@ include file="/common/include/footer.jsp"%>
</body>
</html>